const path = require('path')
const Myplugin = require('./myPlugin/index')

module.exports = {
    mode: 'development',
    entry: {
        index: './example/entry.js'
    },
    output: {
        filename: '[name].js',
        path: path.resolve(__dirname, './dist')
    },
    module: {
        rules: [
            {
                test: /\.css$/,
                use: ['./loader/index.js']
            }
        ]
    },
    plugins: [
        new Myplugin({
            success: (stats) => {
                const assets = stats.compilation.assets
                for (let key in assets) {
                    const dir = path.dirname(assets[key]['existsAt'])
                    console.log(dir)
                }
            },
            failed: (err) => console.log(err)
        })
    ]
}
